import { Component, OnInit } from '@angular/core';
import { MessageService } from 'src/app/core/service/message.service';
import { ApiService } from 'src/app/core/api';
import { NzMessageService } from 'ng-zorro-antd';

@Component({
    templateUrl: './myProject.html',
    styleUrls: ['./myProject.scss']
})
export class MyProjectComponent implements OnInit {
    list = [{
        "id": 1,
        "title": "安全防范高清视频监控系统技术要求",
        v:61,
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        "id": 1,
        v:60,
        "title": "安全防范系统",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:57,
        "id": 1,
        "title": "单位（楼宇）",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:56,
        "id": 1,
        "title": "高安全楼寓对讲系统",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:52,
        "id": 1,
        "title": "城市轨道交通安全防范系统",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:49,
        "id": 1,
        "title": "电力设施",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    }];
    statusDatas=[{
		v: 1,
		name: '委托检测'
	}, {
		v: 2,
		name: '型式检测'
	}, {
		v: 3,
		name: '远程检测'
	}]
    page = {
        status:1,
        porjacts:[
            '安全防范工程系统', '入侵报警类', '视频监控类', '道路交通类', '出入口控制类', 
            '反恐防爆安检类', '生物识别类', '侦查防护类', '电磁兼容类', '电气安全类', '实体防护类',
        '警用装备类',
        '可靠性试验类',
        '信息安全类',
        '公安专用类',
        '软件类',
        '智能联网类',
        '信息系统'
        ],
        array : [
            '../../../../assets/img/home-page/banner1.png', 
            '../../../../assets/img/home-page/banner2.png', 
            '../../../../assets/img/home-page/banner3.png'
        ],		
        hots:[
			{
				titel:'安全防范高清视频监控系统技术要求',
                types:['检测标准','依赖仪器','现场评估'],
                v:6,
                img:'../../../../assets/img/home-page/cmr01.jpg',
                jg:'3.2万',
                beforjg:'4.16万'
			},
			{
				titel:'广播',
				types:['检测标准','依赖仪器','现场评估'],
                img:'../../../../assets/img/home-page/cmr02.jpg',
                jg:'3.2万',
                beforjg:'4.16万'
			},
			{
				titel:'网络摄像机检测',
				types:['检测标准','依赖仪器','现场评估'],
                img:'../../../../assets/img/home-page/cmr03.jpg',
                jg:'3.2万',
                beforjg:'4.16万'
			},
			{
				titel:'网络摄像机检测',
				types:['检测标准','依赖仪器','现场评估'],
                img:'../../../../assets/img/home-page/cmr04.jpg',
                jg:'3.2万',
                beforjg:'4.16万'
			},
			{
				titel:'网络摄像机检测',
				types:['检测标准','依赖仪器','现场评估'],
                img:'../../../../assets/img/home-page/cmr05.jpg',
                jg:'3.2万',
                beforjg:'4.16万'
			},
			{
				titel:'网络摄像机检测',
				types:['检测标准','依赖仪器','现场评估'],
                img:'../../../../assets/img/home-page/cmr06.jpg',
                jg:'3.2万',
                beforjg:'4.16万'
			},
		]
    };
    
    // list = [{
    //     name:'机构：公安三所',
    //     children:[{
    //         name:'test-childen 001'
    //     },{
    //         name:'test-childen 002'
    //     },]
    // }];
    sharchTags = [];

    ngOnInit() {
        this.message.setBreadcrumb({
            breadcrumbs: [
                { name: '我要检测' }
            ]
        });
        this.getSearchData();
    }

    getList(data){
        // this.api.post('我的项目列表', data).then((res: any) => {
        //     this.list = res.data.list;
        // }).catch((res) => {
        //     this.msg.error(res.message);
        // });
    }

    getSearchData(){
        // this.api.post('漏洞类型表(用于选择框)', {}).then((res: any) => {
        //     this.sharchTags = res.data.list;
        //     this.sharchTags.unshift({id:'',name:'全部'})
        //     this.page.vulnerabilityTypeId = this.sharchTags[0].id;
        //     this.sharchTags[0].isSel = true;
        //     this.getList(this.page);
        // })
    }

    handleChange(item) {
        // this.page.vulnerabilityTypeId = item.id;
        // for (let i = 0; i < this.sharchTags.length; i++) {
        //     this.sharchTags[i].isSel = item == this.sharchTags[i] ? true : false;
        // }
        // this.getList( this.page )
    }
    constructor(
        private message: MessageService,
        private msg: NzMessageService,
        private api: ApiService
    ) { }
}